package com.xx.springboot.entity;

import com.xx.springboot.entity.SuperEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.sql.Date;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 *  博客实体
 * </p>
 *
 * @author xiaoxiunique
 * @since 2018-08-06
 */
public class Blog extends SuperEntity<Blog> {

    private static final long serialVersionUID = 1L;

    @NotBlank(message = "标题不能为空")
    private String title;

    private String description;

    @NotNull(message = "博客类型不能为空")
    @TableField("category_id")
    private Integer categoryId;

    private String img;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    private Integer hits;

    private Integer comments;

    /**
     * 0未发布1发布
     */
    private Integer status;

    /**
     * 0未删除1删除 
     */
    @TableField("is_delete")
    private Integer isDelete;

    @TableField("user_id")
    private Long userId;

    /**
     * 0否1是置顶
     */
    @TableField("is_top")
    private Integer isTop;

    @NotBlank(message = "内容不能为空")
    @TableField("source_description")
    private String sourceDescription;


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getHits() {
        return hits;
    }

    public void setHits(Integer hits) {
        this.hits = hits;
    }

    public Integer getComments() {
        return comments;
    }

    public void setComments(Integer comments) {
        this.comments = comments;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getIsTop() {
        return isTop;
    }

    public void setIsTop(Integer isTop) {
        this.isTop = isTop;
    }

    public String getSourceDescription() {
        return sourceDescription;
    }

    public void setSourceDescription(String sourceDescription) {
        this.sourceDescription = sourceDescription;
    }

    @Override
    public String toString() {
        return "Blog{" +
        ", id=" + super.getId() +
        ", title=" + title +
        ", description=" + description +
        ", categoryId=" + categoryId +
        ", img=" + img +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        ", hits=" + hits +
        ", comments=" + comments +
        ", status=" + status +
        ", isDelete=" + isDelete +
        ", userId=" + userId +
        ", isTop=" + isTop +
        ", sourceDescription=" + sourceDescription +
        "}";
    }
}
